filter data based on a condition in json